#include "syscall.h"
//the cat shell command, outputs txt to stdout from a file
int main(int argc, char **argv){
    
    if(argc != 2){
        Exit(1);
    }


    OpenFileId file = Open(argv[1]);

    Write("In CAT\n", 7, ConsoleOutput);

    char buffer[10];


    int bytesRead;
    do {
        bytesRead = Read(buffer, 10, file);
        Write(buffer, bytesRead, ConsoleOutput);
    } while(bytesRead != 0);

    Close(file);
    
    Exit(0);
}
